﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using System.Web.Security;
using Chaine.Models;
using System.Net.Mail;
using Chaine.DAO;
using MongoDB.Bson;

namespace Chaine.Controllers
{
    public class WebEventsController : Controller
    {
        public ActionResult Now()
        {
            var year = EventManager.GetYear().Max();
            var events = EventManager.GetEvents(year.ToString());
            return View("~/views/web/event/index.cshtml", events);
        }

        public ActionResult Index(string year)
        {
            var events = EventManager.GetEvents(year);
            return View("~/views/web/event/index.cshtml", events);
        }

        public ActionResult Detail(string date)
        {
            var e = EventManager.GetEvent(date);
            return View("~/views/web/event/detail.cshtml", e);
        }


    }
}
